
/**************************************************************************************************/
/*                                    All of those crazy verbs!                                   */
/**************************************************************************************************/

client/verb
	Say(msg as text) {
		set {
			hidden = 1
			name = ">"
		}

		if(src.Muted) {
			return 0;
		}

		if(msg&&msg!=null) {
			if(src.Colors == 1) {
				world<<"<b>\[</b>[time2text(world.timeofday,"hh:mm:ss")]<b>\] <font color='[html_encode(Name_Color)]'>[src.key]</font></b>: <font color='[html_encode(Text_Color)]'>[html_encode(msg)]</font>"
			}
			else {
				world<<"<b>\[</b>[time2text(world.timeofday,"hh:mm:ss")]<b>\] [src.key]</b>: [html_encode(msg)]"
			}
		}

		if(src.Status != "Available") {
			src.Status = "Available"
		}
	}

	Emote(msg as text) {
		set {
			hidden = 1
			name = "me"
		}

		if(msg) {
			if(src.Colors == 1) {
				world<<"<b>\[</b>[time2text(world.timeofday,"hh:mm:ss")]<b>\]</b> *<font color='[html_encode(Name_Color)]'>[src.key] [html_encode(msg)]</font>"
			}
			else {
				world<<"<b>\[</b>[time2text(world.timeofday,"hh:mm:ss")]<b>\]</b> *[src.key] [html_encode(msg)]"
			}
		}
		if(!src.Status) {
			src.Status=!src.Status
		}
	}

	ToggleColors() {
		set {
			hidden = 1
		}

		if(src.Colors) {
			src.Colors =! src.Colors
			System_UserMessage(src,"Your colors are now disabled.")
		}

		else {
			src.Colors =! src.Colors
			System_UserMessage(src,"Your colors are now enabled.")
		}
	}

	SetNameColor() {
		set hidden = 1
		Name_Color = input("Please type in a color.","Name Color",src.Name_Color)
	}

	SetTextColor() {
		set hidden = 1
		Text_Color = input("Please type in a color.","Text Color",src.Text_Color)
	}

	ToggleStatus() {
		set {
			hidden = 1
			name = "AFK"
		}

		if(src.Status == "Available" || src.Status == "Typing") {
			do {
				Status_Message = input("Please supply a reason(Max 35 characters).","AFK Message","I have gone AFK.")
			}
			while(length(Status_Message)>35)

			world<<"<b>\[</b>[time2text(world.timeofday,"hh:mm:ss")]<b>\] <font color='[html_encode(Bot_Color)]'>@Wench</font></b>: [src.key] has gone away. ([src.Status_Message])"
			src.Status = "Away"
		}

		else {
			src.Status_Message = "Available"
			world<<"<b>\[</b>[time2text(world.timeofday,"hh:mm:ss")]<b>\] <font color='[html_encode(Bot_Color)]'>@Wench</font></b>: [src.key] has returned!"
			src.Status = "Available"
		}
	}

	SetOutputStyle() {
		set hidden = 1
		var Style = input("Please type in a style.","Style Type")
		winset(src, "Output.Output","style=\"body{font-family: [Style]}")
	}

	SwapPanes() {
		set {
			hidden = 1
		}

		var/splitter = text2num(winget(src,"Main.MainChild","splitter"))
		winset(src,"Main.MainChild","splitter=[100-splitter]")

		if(WhoSide=="Left") {
			winset(src,"Main.MainChild","left=Output")
			winset(src,"Main.MainChild","right=WhoList")
			winset(src,"Main.LeftChatters","is-visible=false")
			winset(src,"Main.RightChatters","is-visible=true")
			winset(src,"Main.Topic","pos=0,0")
			src.WhoSide = "Right"
		}

		else {
			winset(src,"Main.MainChild","left=WhoList")
			winset(src,"Main.MainChild","right=Output")
			winset(src,"Main.LeftChatters","is-visible=true")
			winset(src,"Main.RightChatters","is-visible=false")
			winset(src,"Main.Topic","pos=132,0")
			src.WhoSide = "Left"
		}
	}

	ControlCenter() {
		set
			hidden = 1
			name = "Controls"
		var
			FullPage
			Header = {"<html>
	<head>
		<title>Control Center</title>"}

			Footer = "</body></html>"

			Javascript = ""
			CSS = {"<style type = "text/css">
	body{background: #000; color: #CCC;}
	.controls{background: #1133FF; border: 2px groove #1133FF; width: 400px; padding: 0px; position: absolute; left: 0px; top: 0px}
	.controls td, .controls th{background: #000; border: 2px groove #66AADD;}
	.select select{width: 100%;}
	.input input{width: 100%;}
</style>"}

			Page={"<form name="controlpanel" method="get">
		<table class="controls">
			<tr><th colspan="2">User Settings</th></tr>
			<tr>
				<td>Toggle Colors:</td>
				<td><input type="radio" name="togglecolor" value="on"/>On <input type="radio" name="togglecolor" value="off"/>Off</td>
			</tr>
			<tr>
				<td>User List:</td>
				<td><input type="radio" name="paneside" value="left"/>Left <input type="radio" name="paneside" value="right"/>Right</td>
			</tr>
			<tr>
				<td>Name Color:</td>
				<td class="input"><input type="text" name="namecolor" value="[src.Name_Color]"/></td>
			</tr>
			<tr>
				<td>Text Color:</td>
				<td class="input"><input type="text" name="textcolor" value="[src.Text_Color]"/></td>
			</tr>
			<tr>
				<td>Output Style:</td>
				<td class="input"><input type="text" name="outputstyle" value="[src.Output_Style]"/></td>
			</tr>
			<tr>
				<td>Status:</td>
				<td><input type="radio" name="userstatus" value="available"/>Available <input type="radio" name="userstatus" value="away"/>Away <input type="radio" name="userstatus" value="busy"/>Busy</td>
			</tr>
			<tr>
				<td colspan="2"class="input"><input type="text" name="status" value="[src.Status_Message]"/></td>
			</tr>
			<tr>
				<th colspan="2" align="right"><input type="button" name="submit" value="Submit" onclick="submit(this.form)" /></th>
			</tr>
		</table>
	</form>"}



		FullPage = "[Header][Javascript][CSS][Page][Footer]"
		src<<browse(FullPage,"window=moderation;size=400x280;can_resize=0")
	}